//
//  FriendApplyCell.m
//  Molian
//
//  Created by wansong on 4/16/15.
//  Copyright (c) 2015 xiaocan. All rights reserved.
//

#import "FriendApplyCell.h"

@implementation FriendApplyCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.accessoryType = UITableViewCellAccessoryNone;
        
        
        // 愿意按钮
        self.acceptBtn = [[UIButton alloc]init];
        self.acceptBtn.frame = CGRectMake(DeviceWidth-70, 20, 60, 30);
        self.acceptBtn.layer.masksToBounds = YES;
        [self.acceptBtn.layer setCornerRadius:15.0f];
        self.acceptBtn.titleLabel.font = [UIFont fontWithName:FontName size:14];
        [self.acceptBtn setTitle:@"我愿意" forState:UIControlStateNormal];
        [self.acceptBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        [self.acceptBtn setBackgroundColor:APPCOLOR(1)  ];
        [self.contentView addSubview:self.acceptBtn];
        
        // 留言
        self.remarkLabel = [[UILabel alloc]init];
        self.remarkLabel.frame = CGRectMake(10, 60, DeviceWidth-20, 30);
        self.remarkLabel.font = [UIFont fontWithName:FontName size:14];
        self.remarkLabel.textColor = [UIColor grayColor];
        [self.remarkLabel.layer setCornerRadius:5.0f];
        [self.remarkLabel.layer setBorderWidth:0.5f];
        self.remarkLabel.lineBreakMode = NSLineBreakByWordWrapping;
        self.remarkLabel.numberOfLines = 0;
        self.remarkLabel.textAlignment = NSTextAlignmentLeft;
        [self.remarkLabel.layer setBorderColor:[[UIColorFromRGB(0xe2ddd2) colorWithAlphaComponent:0.6] CGColor]];
        [self.contentView addSubview:self.remarkLabel];
        
        
        UIImageView *icon_triangle_chat_bubble_loveline = [[UIImageView alloc]initWithFrame:CGRectMake(30, 56, 5, 5)];
        icon_triangle_chat_bubble_loveline.image = [UIImage imageNamed:@"icon_triangle_chat-bubble_loveline"];
        [self.contentView addSubview:icon_triangle_chat_bubble_loveline];
        
    }
    return self;
}


-(void)layoutSubviews
{
    [super layoutSubviews];

    if (self.remarkLabel.text.length == 2) {
        self.remarkLabel.hidden = YES;
    }else{
        self.remarkLabel.hidden = NO;
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
